Page({
  data: {
    noticeDetail: {}
  },
  onLoad({
    id
  }) {
    this.getNoticeDetail(id)
  },
  async getNoticeDetail(id) {

    if (typeof id === undefined) return
    const {
      code,
      data: noticeDetail
    } = await wx.http.get('/announcement/' + id)
    if (code !== 10000) return wx.utils.toast()
    this.setData({
      noticeDetail
    })

  }
})